package top.tomxwd.springcloud.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import top.tomxwd.springcloud.pojo.Dept;
import top.tomxwd.springcloud.service.fallback.DeptClientServiceFallbackFactory;

import java.util.List;

/**
 * 提供服务
 *
 * @author xieweidu
 * @createDate 2020-06-16 22:31
 */
@FeignClient(value = "SPRINGCLOUD-DEPT-PV", fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {

    @GetMapping("/dept/get/{id}")
    Dept get(@PathVariable("id") Long id);

    @GetMapping("/dept/list")
    List<Dept> queryAll();

    @PostMapping("/dept/add")
    boolean addDept(Dept dept);

}
